﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LuaFramework;

/// <summary>
/// 玩家角色数据
/// </summary>
public class HeroData
{
    public string name;
    public int lv;
    public int exp;
    public int fightValue;
}
public class HeroManager : Singleton<HeroManager> {

    private string name;

    public string Name
    {
        get
        {
            return name;
        }

        set
        {
            name = value;
        }
    }

    private int lv;

    public int Lv
    {
        get
        {
            return lv;
        }

        set
        {
            lv = value;
            //玩家信息发生改变，重新向服务器请求数据
            EventDispatcher.TriggerEvent(EventKey.CSOnHeroInfo);
        }
    }

    private int exp;

    public int Exp
    {
        get
        {
            return exp;
        }
        set
        {
            exp = value;
            //玩家信息发生改变，重新向服务器请求数据
            EventDispatcher.TriggerEvent(EventKey.CSOnHeroInfo);
        }
    }

    private int fightValue;

    public int FightValue
    {
        get { return fightValue; }
        set
        {
            fightValue = value;
            //玩家信息发生改变，重新向服务器请求数据
            EventDispatcher.TriggerEvent(EventKey.CSOnHeroInfo);
        }
    }


    public void OnReceiveRoleNameResponse(string data)
    {
        Name = data;
    }

}
